<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>deque - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="deque"></a>deque</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class deque #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote><p>Implements a double-ended queue using a queue.</p><h4 class=CHeading>Parameter</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of data collected in a deque.&nbsp; The default is <b>int</b>.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#deque" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">deque</a></td><td class=SDescription>Implements a double-ended queue using a queue.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#deque.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.new" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">new</a></td><td class=SDescription>Creates a new deque.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.add" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">add</a></td><td class=SDescription><span class="virtual">virtual</span> Adds the given element at the end of this deque.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.add_first" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">add_first</a></td><td class=SDescription><span class="virtual">virtual</span> Adds the given element at the front of this deque.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.add_last" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">add_last</a></td><td class=SDescription><span class="virtual">virtual</span> Adds the given element at the end of this deque.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.clear" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">clear</a></td><td class=SDescription><span class="virtual">virtual</span> Removes all of the elements from this deque.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.clone" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">clone</a></td><td class=SDescription><span class="virtual">virtual</span> Returns a shallow copy of this deque. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.contains" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">contains</a></td><td class=SDescription><span class="virtual">virtual</span> Returns 1 if this deque contains the specified element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.get" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">get</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.get_first" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">get_first</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.get_last" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">get_last</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the tail of the deque and remove the element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.get_iterator" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">get_iterator</a></td><td class=SDescription><span class="virtual">virtual</span> Returns an iterator over the elements in this deque.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.get_descending_iterator" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">get_descending_iterator</a></td><td class=SDescription><span class="virtual">virtual</span> Returns an iterator over the elements in this deque in reverse order.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.peek" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">peek</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.peek_first" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">peek_first</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.peek_last" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">peek_last</a></td><td class=SDescription><span class="virtual">virtual</span> Retrieves the tail of the deque but does not remove the element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.pop" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">pop</a></td><td class=SDescription><span class="virtual">virtual</span> Pops an element from the deque as if it is a stack.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.push" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">push</a></td><td class=SDescription><span class="virtual">virtual</span> Pushes an element to the deque as if it is a stack.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.remove" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">remove</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the specified element from this deque. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.remove_first" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">remove_first</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the first element from this deque.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.remove_last" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">remove_last</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the last element from this deque.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.remove_first_occurrence" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">remove_first_occurrence</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the first occurrence of the specified element by traversing the deque from head to tail.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#deque.remove_last_occurrence" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">remove_last_occurrence</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the last occurrence of the specified element by traversing the deque from tail to head.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#deque.size" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">size</a></td><td class=SDescription><span class="virtual">virtual</span> Returns the number of elements in this deque.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="deque.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.new"></a>new</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new deque.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>c</td><td class=CDLDescription><span class="optional">optional</span> A collection whose elements are to be added to this deque.</td></tr><tr><td class=CDLEntry>cmp</td><td class=CDLDescription><span class="optional">optional</span> A strategy object used to compare the elements of type <b>T</b>.&nbsp; If not specified or <b>null</b>, <a href="cl_comparator-svh.html#comparator" class=LClass id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">comparator</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr><tr><td class=CDLEntry>fmtr</td><td class=CDLDescription><span class="optional">optional</span> A strategy object that provides a function to convert the element of type <b>T</b> to a string.&nbsp; If not specified or <b>null</b>, <a href="cl_hex_formatter-svh.html#hex_formatter" class=LClass id=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">hex_formatter</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.add"></a>add</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Adds the given element at the end of this deque.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added to this deque.</td></tr></table><h4 class=CHeading>Returns</h4><p>Always returns 1.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

assert( int_dq.add( 123 ) == 1 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.add_first"></a>add_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void add_first(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Adds the given element at the front of this deque.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added to this deque.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

int_dq.add_first( 123 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.add_last"></a>add_last</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void add_last(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Adds the given element at the end of this deque.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added to this deque.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

int_dq.add_last( 123 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.clear"></a>clear</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function void clear()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes all of the elements from this deque.</p><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

int_dq.clear();</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.clone"></a>clone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function collection#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) clone()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns a shallow copy of this deque.&nbsp; The element themselves are not cloned.</p><h4 class=CHeading>Returns</h4><p>A copy of this deque.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
collection#(int) cloned;

cloned = int_dq.clone();</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.contains"></a>contains</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit contains(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns 1 if this deque contains the specified element.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be checked.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this deque contains <b>e</b>, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
assert( int_dq.contains( 123 ) == 1 );
assert( int_dq.contains( 456 ) == 0 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.get"></a>get</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element.&nbsp; This function is equivalent to <a href="#deque.get_first" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt10', 'link27')" onMouseOut="HideTip('tt10')">get_first</a>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The head of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
assert( int_dq.get( i ) == 1 );
assert( i == 123 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.get_first" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt10', 'link28')" onMouseOut="HideTip('tt10')">get_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.get_first"></a>get_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get_first(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The head of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
assert( int_dq.get_first( i ) == 1 );
assert( i == 123 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.get" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt9', 'link29')" onMouseOut="HideTip('tt9')">get</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.get_last"></a>get_last</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get_last(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the tail of the deque and remove the element.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The tail of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
assert( int_dq.get_last( i ) == 1 );
assert( i == 123 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.get_first" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt10', 'link30')" onMouseOut="HideTip('tt10')">get_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.get_iterator"></a>get_iterator</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_iterator()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns an iterator over the elements in this deque.</p><h4 class=CHeading>Returns</h4><p>An iterator.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
iterator#(int) it;
string s;

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
it = int_dq.get_iterator();
while ( it.has_next() ) s = { s, $sformatf( &quot;%0d &quot;, it.next() ) };
assert( s == &quot;123 456 &quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.get_descending_iterator"></a>get_descending_iterator</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_descending_iterator()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns an iterator over the elements in this deque in reverse order.</p><h4 class=CHeading>Returns</h4><p>A descending iterator.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
iterator#(int) it;
string s;

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
it = int_dq.get_descending_iterator();
while ( it.has_next() ) s = { s, $sformatf( &quot;%0d &quot;, it.next() ) };
assert( s == &quot;456 123 &quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.peek"></a>peek</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element.&nbsp; This function is equivalent to <a href="#deque.peek_first" class=LFunction id=link31 onMouseOver="ShowTip(event, 'tt15', 'link31')" onMouseOut="HideTip('tt15')">peek_first</a>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The head of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.peek( i ) == 1 );
assert( i == 123 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.peek_first" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt15', 'link32')" onMouseOut="HideTip('tt15')">peek_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.peek_first"></a>peek_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek_first(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The head of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.peek_first( i ) == 1 );
assert( i == 123 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.peek" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt14', 'link33')" onMouseOut="HideTip('tt14')">peek</a>, <a href="#deque.peek_last" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt16', 'link34')" onMouseOut="HideTip('tt16')">peek_last</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.peek_last"></a>peek_last</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek_last(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Retrieves the tail of the deque but does not remove the element.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>The tail of the deque to be returned.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>e</b> is valid, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();
int i;

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.peek_last( i ) == 1 );
assert( i == 456 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.peek_first" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt15', 'link35')" onMouseOut="HideTip('tt15')">peek_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.pop"></a>pop</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function T pop()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Pops an element from the deque as if it is a stack.</p><h4 class=CHeading>Returns</h4><p>The head of the deque.&nbsp; If the deque is empty, the value of type <b>T</b> read from a nonexistent queue entry is returned (See IEEE Std 1800-2012 Table 7-1).</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

int_dq.push( 123 );
int_dq.push( 456 );
assert( int_dq.pop() == 456 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.push"></a>push</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void push(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Pushes an element to the deque as if it is a stack.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to push.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

int_dq.push( 123 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.remove"></a>remove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the specified element from this deque.&nbsp; This function is equivalent to <a href="#deque.remove_first_occurrence" class=LFunction id=link36 onMouseOver="ShowTip(event, 'tt22', 'link36')" onMouseOut="HideTip('tt22')">remove_first_occurrence</a>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be removed.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this deque changed as a result of the call, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.remove( 123 ) == 1 );
assert( int_dq.remove( 789 ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p>&lt;remove_first_occurence&gt;</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.remove_first"></a>remove_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit remove_first()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the first element from this deque.</p><h4 class=CHeading>Returns</h4><p>If this deque is not empty, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
assert( int_dq.remove_first() == 1 );
assert( int_dq.remove_first() == 0 ); // deque is empty</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.remove_last"></a>remove_last</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit remove_last()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the last element from this deque.</p><h4 class=CHeading>Returns</h4><p>If this deque is not empty, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
assert( int_dq.remove_last() == 1 );
assert( int_dq.remove_last() == 0 ); // deque is empty</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.remove_first_occurrence"></a>remove_first_occurrence</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_first_occurrence(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the first occurrence of the specified element by traversing the deque from head to tail.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be removed.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this deque changed as a result of the call, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.remove_first_occurrence( 123 ) == 1 );
assert( int_dq.remove_first_occurrence( 789 ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.remove" class=LFunction id=link37 onMouseOver="ShowTip(event, 'tt19', 'link37')" onMouseOut="HideTip('tt19')">remove</a>, <a href="#deque.remove_last_occurrence" class=LFunction id=link38 onMouseOver="ShowTip(event, 'tt23', 'link38')" onMouseOut="HideTip('tt23')">remove_last_occurrence</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.remove_last_occurrence"></a>remove_last_occurrence</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_last_occurrence(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the last occurrence of the specified element by traversing the deque from tail to head.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be removed.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this deque changed as a result of the call, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
void'( int_dq.add( 456 ) );
assert( int_dq.remove_last_occurrence( 123 ) == 1 );
assert( int_dq.remove_last_occurrence( 789 ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#deque.remove" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt19', 'link39')" onMouseOut="HideTip('tt19')">remove</a>, <a href="#deque.remove_first_occurrence" class=LFunction id=link40 onMouseOver="ShowTip(event, 'tt22', 'link40')" onMouseOut="HideTip('tt22')">remove_first_occurrence</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="deque.size"></a>size</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function int size()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns the number of elements in this deque.</p><h4 class=CHeading>Returns</h4><p>The number of elements in this deque.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">deque#(int) int_dq = new();

void'( int_dq.add( 123 ) );
assert( int_dq.size() == 1 );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class deque #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote>Implements a double-ended queue using a queue.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new deque.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Adds the given element at the end of this deque.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void add_first(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Adds the given element at the front of this deque.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void add_last(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Adds the given element at the end of this deque.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function void clear()</td></tr></table></blockquote><span class="virtual">virtual</span> Removes all of the elements from this deque.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function collection#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) clone()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns a shallow copy of this deque. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit contains(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns 1 if this deque contains the specified element.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get_first(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the head of the deque and remove the element.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit get_last(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the tail of the deque and remove the element.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_iterator()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns an iterator over the elements in this deque.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_descending_iterator()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns an iterator over the elements in this deque in reverse order.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek_first(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the head of the deque but does not remove the element.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit peek_last(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Retrieves the tail of the deque but does not remove the element.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function T pop()</td></tr></table></blockquote><span class="virtual">virtual</span> Pops an element from the deque as if it is a stack.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function void push(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Pushes an element to the deque as if it is a stack.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Removes the specified element from this deque. </div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit remove_first()</td></tr></table></blockquote><span class="virtual">virtual</span> Removes the first element from this deque.</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit remove_last()</td></tr></table></blockquote><span class="virtual">virtual</span> Removes the last element from this deque.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_first_occurrence(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Removes the first occurrence of the specified element by traversing the deque from head to tail.</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_last_occurrence(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Removes the last occurrence of the specified element by traversing the deque from tail to head.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function int size()</td></tr></table></blockquote><span class="virtual">virtual</span> Returns the number of elements in this deque.</div></div><div class=CToolTip id="tt25"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class comparator#(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides strategies to compare objects.</div></div><div class=CToolTip id="tt26"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class hex_formatter #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends formatter#( T )</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides a strategy to convert an object of type <b>T</b> to a string using a hexadecimal format.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>